﻿#include "dialog.h"
#include "ui_dialog.h"

Dialog::Dialog(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::Dialog)
{
    ui->setupUi(this);

    ui->comboBox->addItem(QString());
    QDir dir("://Lua");
    QFileInfoList fileInfoList = dir.entryInfoList();
    foreach(QFileInfo fileInfo, fileInfoList)
        ui->comboBox->addItem(fileInfo.filePath());

    new Highlighter(ui->textEdit->document());
}

Dialog::~Dialog()
{
    delete ui;
}

void Dialog::on_pushButton_clicked()
{
    QLua lua;
    lua.run(ui->textEdit->toPlainText());
}

void Dialog::on_pushButton_2_clicked()
{
}
